﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SachVietDLL.BLL
{
    public abstract class SorterBy
    {
        public void Sort(List<BookDetail> list)
        {
            int size = list.Count;
             for(int i = 0; i<size; i++)
                for (int j = i + 1; j < size; j++)
                {
                   if(Compare(list[i],list[j]))
                   {
                       BookDetail book = list[i];
                       list[i] = list[j];
                       list[j] = book;
                   }
                }
        }

        protected abstract bool Compare(BookDetail bookDetail1, BookDetail bookDetail2);       
    }
}
